#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5,mod=1e9+7;
long long n,m,x,y,f[N];
void dfs(int i)
{
	if(i==y) return;
	if(i*2<=y) f[i*2]=(f[i*2]+f[i])%mod;
	f[i+1]=(f[i+1]+f[i])%mod;
	dfs(i+1);
}
int main()
{
	freopen("op.in","r",stdin);
	freopen("op.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>x>>y;
	if(y>1e5) return 0;
	f[x]=1;
	dfs(x);
	cout<<f[y];
	return 0;
 } 
